home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 April / EnigmA AMIGA RUN 17 (1997)(G.R. Edizioni)(IT)[!][issue 1997-04][EAR-CD].iso / EARCD / comm / bbs / PagEr.lha / PagE!r / PagE!r_sysop < prev    next >
Text File  |  1996-11-10  |  3KB  |  110 lines

  1. /*************************************************************************/
  2. /*                    PagE!r_Sysop v1.0  by Morpheus                     */
  3. /*************************************************************************/
  4. /* busymsg: message that will be sent to the user when you activate the  */
  5. /*          busy gadget                                                  */
  6. /* chatmsg: message that will be sent to the user when you activate the  */
  7. /*          chat gadget                                                  */
  8. /*************************************************************************/
  9. busymsg="Sorry, I'm too busy to chat with you right now!"
  10. chatmsg="The sysop is coming!"
  11. /********************************* Script ********************************/
  12. options results
  13. parse arg node poort .
  14. alias=getclip('PagE!r'||node||'_alias')
  15. reason=getclip('PagE!r'||node||'_reason')
  16. host='PAGERHOST'||node
  17. port='PAGERPORT'||node
  18. if ~show(l,'rexxarplib.library') then;do
  19. if ~addlib("rexxarplib.library",0,-30,0) then;do
  20. say "Can't open rexxarplib.library"
  21. exit
  22. end
  23. end
  24. address VALUE poort
  25. bbsidentify SYSOP
  26. sysop=result
  27. address
  28. address AREXX "'call CreateHost("host","port")'"
  29. do 50 while ~show('P',host)
  30. call delay(10)
  31. end
  32. if ~show('P',host) then;do
  33. call Request(112,100,'Error: Could not create controlport for PagE!r',,' OKAY ',,)
  34. exit
  35. end
  36. idcmp='GADGETUP'
  37. flags='WINDOWDRAG+WINDOWDEPTH+ACTIVATE'
  38. call OpenWindow(host,112,100,416,75,idcmp,flags,"PagE!r v1.0  by Morpheus")
  39. call AreaMove(host,4,11)
  40. call AreaDraw(host,411,11)
  41. call AreaDraw(host,411,73)
  42. call AreaDraw(host,4,73)
  43. call AreaEnd(host,562)
  44. call SetAPen(host,0)
  45. call RectFill(host,10,14,405,54)
  46. call RectFill(host,10,59,61,68)
  47. call RectFill(host,82,59,125,68)
  48. call RectFill(host,146,59,197,68)
  49. call RectFill(host,218,59,325,68)
  50. call RectFill(host,346,59,405,68)
  51. call SetAPen(host,1)
  52. call RectFill(host,8,13,9,54)
  53. call SetAPen(host,2)
  54. call Move(host,9,54)
  55. call Draw(host,407,54)
  56. call RectFill(host,406,13,407,54)
  57. call SetAPen(host,1)
  58. call Move(host,8,13)
  59. call Draw(host,406,13)
  60. call AddGadget(host,10,59,1,' Chat ',1)
  61. call AddGadget(host,82,59,2,' IUM ',2)
  62. call AddGadget(host,146,59,3,' Busy ',3)
  63. call AddGadget(host,218,59,4,' Unavailable ',4)
  64. call AddGadget(host,346,59,5,' Abort ',5)
  65. call WindowText(host,'User  : '||alias||'\Node  : '||node||'\Reason: '||reason)
  66. call ScreenToFront()
  67. quitflag=0
  68. call openport(port)
  69. do until quitflag=1
  70. call waitpkt(port)
  71. packet=getpkt(port)
  72. if packet ~=null() then;do
  73. cmd=getarg(packet)
  74. if index("12345",cmd)~=0 then quitflag=1
  75. call reply(packet,0)
  76. end
  77. end
  78. call CloseWindow(host)
  79. call ClosePort(port)
  80. select
  81. when cmd='1' then;do
  82. address VALUE poort
  83. openscreen
  84. address
  85. call sendmsg(chatmsg)
  86. end
  87. when cmd='2' then;do
  88. call request(20,100,' Enter the message that you would like to sent to the user (max. 70) : ','',,,)
  89. msg=result
  90. if msg~='' then call sendmsg(msg)
  91. end
  92. when cmd='3' then call sendmsg(busymsg)
  93. when cmd='4' then;do
  94. if show('P',AVAILPORT) then
  95. address AVAILPORT '2'
  96. else call setclip('SysopAvail','FALSE')
  97. end
  98. otherwise nop
  99. end
  100. exit
  101. sendmsg:
  102. line=arg(1)
  103. address VALUE poort
  104. transmit '\@6\n2\z4\c3Message from the sysop\n1'
  105. transmit '\c7From   :\z0\c6 '||sysop
  106. if length(line)>70 then line=left(line,70)
  107. transmit '\z4\c7Message:\z0\c6 '||line
  108. if cmd~='1' then feedback
  109. transmit '\n1\q1Press [ENTER] to continue!'
  110. return